home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 July
/
EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso
/
earkit
/
news
/
thor
/
hd-install
/
thor.lha
/
rexx
/
Resend.thor
< prev
next >
Wrap
Text File
|
1996-10-26
|
3KB
|
124 lines
/* Resend.thor by Sigbjørn Skjæret
** $VER: Resend.thor v1.2 (16.11.95)
**
** Resends a message from you...
*/
options results
p = ' ' || address() || ' ' || show('P',,)
thorport = pos(' THOR.',p)
if thorport > 0 then thorport = word(substr(p,thorport+1),1)
else
do
say 'No THOR port found!'
exit 10
end
if ~show('p', 'BBSREAD') then
do
address command
"run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
"WaitForPort BBSREAD"
end
address(thorport)
CURRENTMSG stem CURRENT
if(rc ~= 0) then
do
REQUESTNOTIFY TEXT '"'"Error:" upper(left(THOR.LASTERROR, 1)) || delstr(THOR.LASTERROR, 1, 1)'"' BT '"_OK"'
exit
end
GETMSGLISTSELECTED array
if(rc ~= 0) then
do
if(rc ~= 30) then exit
REQUESTNOTIFY TEXT '"'"Error:" upper(left(THOR.LASTERROR, 1)) || delstr(THOR.LASTERROR, 1, 1)'"' BT '"_OK"'
exit
end
if(array.count=0) then
do
array.count=1
array.1=CURRENT.MSGNR
end
do n=1 to array.count
address BBSREAD READBRMESSAGE '"'CURRENT.BBSNAME'"' '"'CURRENT.CONFNAME'"' array.n headstem HEADTAGS textstem TEXTTAGS datastem DATATAGS
if(rc ~= 0) then
do
REQUESTNOTIFY TEXT '"'"Error:" upper(left(BBSREAD.LASTERROR, 1)) || delstr(BBSREAD.LASTERROR, 1, 1)'"' BT '"_OK"'
exit
end
address BBSREAD GETBBSDATA bbsname '"'CURRENT.BBSNAME'"' stem BBSDATA
if(rc ~= 0) then
do
REQUESTNOTIFY TEXT '"'"Error:" upper(left(BBSREAD.LASTERROR, 1)) || delstr(BBSREAD.LASTERROR, 1, 1)'"' BT '"_OK"'
exit
end
if(BBSDATA.USERNAME = '') then
do
address BBSREAD GETGLOBALDATA stem GLOBALDATA
if(rc ~= 0) then
do
REQUESTNOTIFY TEXT '"'"Error:" upper(left(BBSREAD.LASTERROR, 1)) || delstr(BBSREAD.LASTERROR, 1, 1)'"' BT '"_OK"'
exit
end
if(GLOBALDATA.USERNAME = '') then call NoUser
else username = GLOBALDATA.USERNAME
end
else username = BBSDATA.USERNAME
if(username ~= HEADTAGS.FROMNAME) then call NotMine
address BBSREAD UNIQUEMSGFILE '"'CURRENT.BBSNAME'"' stem MSG
if(rc ~= 0) then
do
REQUESTNOTIFY TEXT '"'"Error:" upper(left(BBSREAD.LASTERROR, 1)) || delstr(BBSREAD.LASTERROR, 1, 1)'"' BT '"_OK"'
exit
end
call open(data, MSG.NAME, W)
do i = 1 to TEXTTAGS.TEXT.COUNT
call writeln(data, TEXTTAGS.TEXT.i)
end
if(bitand(DATATAGS.FLAGS, '00000004'x) = '00000004'x) then priv = 1
else priv = 0
if(HEADTAGS.TONAME = 'HEADTAGS.TONAME') then HEADTAGS.TONAME = 'ALL'
drop EVENT
EVENT.TONAME = HEADTAGS.TONAME
if(HEADTAGS.TOADDR ~= 'HEADTAGS.TOADDR') then EVENT.TOADDR = HEADTAGS.TOADDR
EVENT.SUBJECT = HEADTAGS.SUBJECT
EVENT.CONFERENCE = CURRENT.CONFNAME
EVENT.MSGFILE = MSG.FILEPART
EVENT.PRIVATE = priv
address BBSREAD WRITEBREVENT '"'CURRENT.BBSNAME'"' 0 stem EVENT
if(rc ~= 0) then
do
REQUESTNOTIFY TEXT '"'"Error:" upper(left(BBSREAD.LASTERROR, 1)) || delstr(BBSREAD.LASTERROR, 1, 1)'"' BT '"_OK"'
exit
end
end
exit
NotMine:
REQUESTNOTIFY TEXT '"'"Sorry, this script can only be used on messages from you!"'"' BT '"Hey, I know who I am! (I think)"'
exit
NoUser:
REQUESTNOTIFY TEXT '"'"Sorry, I couldn't seem to find your name?!"'"' BT '"Gimme a break!?!"'
exit